<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'editschedule.jsp' starting page</title>
    
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link href="css/allpage.css" rel="stylesheet" media="all" />
    <script type="text/javascript"
	src="js/jquery-ui-1.11.4.custom/external/jquery/jquery.js"></script>
<script type="text/javascript"
	src="js/jquery-ui-1.11.4.custom/jquery-ui.js"></script>
    <script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
        <script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
    		<script type="text/javascript" language="javascript" src="js/ratingsys.js"></script> 
	<style type="text/css">
    #rateStatus{float:left; clear:both; width:100%; height:30px;}
    #important1{ clear:both; width:100%;  padding:0px; margin:0px;}
    #important1 li{float:left;list-style:none;}
    #important1 li a:hover,
    #important1 .on{background:url(images/2.gif) no-repeat;width:30px;height:30px;}
    #important1 a{float:left;background:url(images/1.gif) no-repeat;width:30px; height:30px;}
    #ratingSaved{display:none;}
    .saved{color:red; }   </style> 
     <script type="text/javascript">
     $(document).ready(function(){
     var isWholeDay=<s:property value="isWholeDay"/>;
     var status=<s:property value="status"/>;
      var important=<s:property value="important"/>;
      var start;
      if(important==1){
       start=document.getElementById("_1");
      rating(start,'1',5,1);
      }else if(important==2){
      start=document.getElementById("_2");
        rating(start,'1',5,1);
      }else if(important==3){
      start=document.getElementById("_3");
        rating(start,'1',5,1);
      }else if(important==4){
      start=document.getElementById("_4");
        rating(start,'1',5,1);
      }else {
      start=document.getElementById("_5");
        rating(start,'1',5,1);
      }
      var starsnum = 1; 
     $("#_1").click(function(){
     starsnum = 1;
    $("input[name='important']").val(starsnum);
     
     });
          $("#_2").click(function(){
     starsnum = 2;
         $("input[name='important']").val(starsnum);
     
     });
          $("#_3").click(function(){
     starsnum = 3;    $("input[name='important']").val(starsnum);
     
     });
          $("#_4").click(function(){
     starsnum = 4;    $("input[name='important']").val(starsnum);
     
     });
          $("#_5").click(function(){
     starsnum = 5;    $("input[name='important']").val(starsnum);
     
     });
    
     if(isWholeDay==true){
     $("input[name='isWholeDay']").eq(0).attr("checked","checked");
     }else{
     $("input[name='isWholeDay']").eq(1).attr("checked","checked");
     }
     if(status==1){
      $("input[name='status']").eq(0).attr("checked","checked");
     }else{
       $("input[name='status']").eq(1).attr("checked","checked");
     }
     $("input[name='confirm']").click(function(){
//       $("form").attr("action","updateTaskJson.action");
	//alert( $("input[name='content']").val());
     $("form").submit();
//        window.close();
     
     });
      $("input[name='delete']").click(function(){
       $("form").attr("action","deleteTaskJson.action");
         $("form").submit();
//         window.close();
      });
      $("input[name='cancel']").click(function(){
//        window.close();
      });
     
     });
     </script>
  </head>
  
  <body>
    <form method="post" action="updateTaskJson.action">
    <input type="hidden"  name="id"  value=<s:property value="id"/>>
<table width="250px" border="1px" cellspacing="1" bordercolor="#">
  
  <tr>
    <td colspan="2" align="center"><input height="30px" style="width:240px;size:40px;padding-left:5px;"  id="content" name="content" value='<s:property value="content"/>' type="text"></td>
  </tr>
  <tr>
    <td width="70">全天时间</td>
    <td width="180"><input type="radio"  name="isWholeDay" >是<input type="radio"  name="isWholeDay" value=false>否</td>
  </tr>
  <tr>
    <td>开始时间</td>
    <td align="center"><input height="20px" type="text" style="width:160px;" value='<s:property value="startTime"/>' onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})
" name="startTime"></td>
  </tr>
  <tr>
    <td>结束时间</td>
    <td align="center"><input height="20px" type="text" style="width:160px" value='<s:property value="endTime"/>' onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})
"  name="endTime"></td>
  </tr>
  <tr>
    <td>任务地点</td>
    <td align="center"><input height="20px" type="text" style="width:160px;"  value='<s:property value="address"/>' name="address"></td>
  </tr>
  
   <tr>
    <td id="rateStatus1">任务星级</td>
 <td align="center">
<div id="important1"title="任务星级">
<input type="hidden" name="important"   value='<s:property value="important"/>'>
    <a onClick="rateIt(this,'1',5,1)"id="_1"  title="较差" onMouseOver="rating(this,'1',5,1)" onMouseOut="off(this,'1',5,1)"></a>
    <a onClick="rateIt(this,'1',5,1)"  id="_2" title="普通" onMouseOver="rating(this,'1',5,1)" onMouseOut="off(this,'1',5,1)"></a>
    <a onClick="rateIt(this,'1',5,1)"   id="_3" title="紧急" onMouseOver="rating(this,'1',5,1)" onMouseOut="off(this,'1',5,1)"></a>
     <a onClick="rateIt(this,'1',5,1)"  id="_4" title="很紧急" onMouseOver="rating(this,'1',5,1)" onMouseOut="off(this,'1',5,1)"></a>
      <a onClick="rateIt(this,'1',5,1)"   id="_5" title="相当紧急" onMouseOver="rating(this,'1',5,1)" onMouseOut="off(this,'1',5,1)"></a>
</div>

</td>
  </tr>
  
  <tr>
  	<td>是否完成</td>
    <td>
    	<input type="radio" name="status" value=1>是
		<input type="radio" name="status" value=0>否
    </td>
  </tr>
<tr>
    <td>确定</td>
    <td align="center"><input height="20px" type="button"   name="confirm" value="确定">
    <input height="20px" type="button"   name="cancel" value="取消">
    <input height="20px" type="button"   name="delete" value="删除">
    </td>
  </tr>
</table> 
</form>
  </body>
</html>
